<template>
  <div class="hung-panel flex flex-flow" :style="{width: hungPanelWidth}">
    <div class="hung-panel-title" :style="{background: 'url('+titlePic+') no-repeat'}"></div>
    <div v-for="(item, index) in listDatas.datas" class="panel-item" :key="index" @click="itemClick(item)" style="color:darkgrey; margin: 15px 15px; cursor: pointer">
      <div class="panel-bg" :style="{background: 'url('+listDatas.imageSrc+') no-repeat '+(-item.hPos)+'px '+(-item.vPos)+'px', width: panelBgWidth, height: panelBgHeight}">
      </div>
      <slot :item="item">
        give you color see
      </slot >
    </div>
  </div>
</template>

<script>

export default {
  props: {
    titlePic: '',
    hungPanelWidth: '',
    panelBgWidth: '',
    panelBgHeight: '',
    listDatas: {}
  },
  mounted () {
  },
  data () {
    return {

    }
  },

  methods: {
    itemClick (item) {
      this.$emit('itemclick', item)
    }
  }
}
</script>

<style scoped>
  .hung-panel {
    position: relative;
    margin-top: 60px;
    margin-bottom: 60px;
    border: 1px solid white;
    box-sizing: border-box;
    padding: 10px 0px;
  }

  .hung-panel-title {
    position: absolute;
    top: -96px;
    left: 413px;
    display: block;
    width: 50%;
    height: 96px;
  }
  .panel-bg {
    width:200px;
    height: 180px;
  }
</style>
